package com.kc.controller;


import com.kc.bean.Comment;
import com.kc.service.ICommentService;
import com.kc.util.ResponesBean;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author jobob
 * @since 2019-10-25
 */
@RestController
@RequestMapping("/pet/comment")
public class CommentController {

    @Resource
    private ResponesBean responesBean;

    @Resource
    private ICommentService commentService;

    @PostMapping("postacomment")
    public ResponesBean postacomment(@RequestBody Comment comment, HttpServletRequest request) {

        String token = request.getHeader("AcessToken");
        responesBean = commentService.AddComment(comment, token);
        return responesBean;

    }

}
